<?php
require_once('pworks/util/MemcacheHelper.class.php');
abstract class SessionHelper {
	public static function getData() {
		$data = MemcacheHelper::get($_COOKIE["__sessid__"]);
		if (!$data) {
			$data = array();
		}
		return $data;
	}
	public static function setData($data) {
		MemcacheHelper::set($_COOKIE["__sessid__"], $data);
	}
	public static function set($key, $value) {
		$data = self::getData();
		$data[$key] = $value;
		self::setData($data);
	}
	public static function get($key) {
		$data = self::getData();
		return $data[$key];
	}
	public static function clear() {
		MemcacheHelper::delete($_COOKIE["__sessid__"]);
	}
	public static function getSessId() {
		return $_COOKIE["__sessid__"];
	}
}
